#include "MyShape.h"

class MyTriangle: public MyShape
{
private:
	char* _stroke;	
	float _strokeWidth;
	int _x1;
	int _y1;
	int _x2;
	int _y2;
	int _x3;
	int _y3;
public:
	//Get methods
	int GetX1() { return this->_x1; }
	int GetY1() { return this->_y1; }
	int GetX2() { return this->_x2; }
	int GetY2() { return this->_y2; }
	int GetX3() { return this->_x3; }
	int GetY3() { return this->_y3; }
	//Default constructor
	MyTriangle() {
		
	}
	//Parameterized constructors
	MyTriangle(char stroke[], float strokeWidth, int x1, int y1, int x2, int y2, int x3, int y3) {
		_stroke = stroke;		
		_strokeWidth = strokeWidth;
		_x1 = x1;
		_y1 = y1;
		_x2 = x2;
		_y2 = y2;
		_x3 = x3;
		_y3 = y3;
	}	
	//Override methods
	void Draw() {
		this->GetMyGraphic()->DrawLine(_stroke, _strokeWidth, _x1, _y1, _x2, _y2);
		this->GetMyGraphic()->DrawLine(_stroke, _strokeWidth, _x1, _y1, _x3, _y3);
		this->GetMyGraphic()->DrawLine(_stroke, _strokeWidth, _x3, _y3, _x2, _y2);
	}
	string ToString() {
		string s = "";
		MyShape* line1 = new MyLine(_stroke, _strokeWidth, _x1, _y1, _x2, _y2);
		string sline1 = line1->ToString();
		MyShape* line2 = new MyLine(_stroke, _strokeWidth, _x1, _y1, _x3, _y3);
		string sline2 = line2->ToString();
		MyShape* line3 = new MyLine(_stroke, _strokeWidth, _x3, _y3, _x2, _y2);
		string sline3 = line3->ToString();
		s += sline1;
		s += sline2;
		s += sline3;

		delete line1;
		delete line2;
		delete line3;

		return s;
	}
	string GetName() {
		return "MyTriangle";
	}
	//Destructor
	~MyTriangle() {
		//delete _stroke;		
	}
};